<?php
/**
 * -----------------------------------------------------
 *
 * models Member_model
 *
 * @package     models
 * @subpackage  
 * @category    Member_model  - 会员模型控制器 
 * @author      ChenFu  - 577274701@qq.com
 * @since       2015-8-1 version 1.0       
 * -----------------------------------------------------    
 */
class Member_model extends CI_Model
{    
	const TABLE = 'dd_member';

	public static $error;
	
	public function __construct()
	{
		parent::__construct();
        $this->load->database();
	}


	/**
	 * [get_member_info_by_username 根据会员名称回去会员信息]
	 * @param  [type] $username [description]
	 * @return [type]           [description]
	 */
	public function get_member_info_by_username($username){
		$this->db->where('uname',$username);
		$query = $this->db->get(self::TABLE);
		return $query->row_array();
	}

	/**
	 * [get_member_info_by_uid 根据会员id查询会员信息]
	 * @param  [type] $username [description]
	 * @return [type]           [description]
	 */
	public function get_member_info_by_uid($uid){
		$this->db->where('uid',$uid);
		$query = $this->db->get(self::TABLE);
		return $query->row_array();
	}


	/**
	 * [update_member 更新会员信息]
	 * @param  [type] $uid  [description]
	 * @param  [type] $data [description]
	 * @return [type]       [description]
	 */
	public function update_member($uid,$data){
		if($this->db->update(self::TABLE,$data,'uid = '.$uid)){
			return true;
		}else{
			return false;
		}
	}




}